package cn.vawn.exam.mapper;

import cn.vawn.exam.entity.PaperType;
import cn.vawn.exam.entity.QuestionsType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface QuestionsTypeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(QuestionsType record);

    int insertSelective(QuestionsType record);

    QuestionsType selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(QuestionsType record);

    int updateByPrimaryKey(QuestionsType record);

    List<QuestionsType> selectAllType();

    List<PaperType> searchQuestionType(@Param("typeName") String typeName,
                                    @Param("startTime") Date startTime,
                                    @Param("endTime") Date endTime);

    int update(QuestionsType questionsType);

    QuestionsType selectById(@Param("id") Integer id);

    @Delete("UPDATE QUESTIONS_TYPE SET IS_DELETED = 1, UPDATED_TIME = #{updatedTime}, UPDATED_BY = #{updatedBy} WHERE ID = #{id}")
    void delete(QuestionsType questionsType);
}